import React from 'react'

export default function Tabs(props) {
  return (
    <div className="tabs">
      <ul>
        {props.tabs.map((item) => {
          return (
            <li
              key={item.id}
              className={props.tabName === item.name ? 'active' : ''}
              onClick={() => {
                props.handleSetTab(item.name)
              }}
            >
              <img src={item.icon} />
              <span>{item.text}</span>
            </li>
          )
        })}
      </ul>
    </div>
  )
}
